<?php
class District_infos extends Admin_Controller
{
	function __construct()
	{
		parent::__construct();
	}
	
	function form($id=FALSE){
		$data['district_info'] = new District_info($id);
		$this->template->build('admin/district_info_form',$data);
	}
	
	function save($id=FALSE){
		if($_POST){
			$district_info = new District_info($id);
			if(!$id)$_POST['user_id'] = $this->session->userdata('id');
			$district_info->from_array($_POST);
			$district_info->save();
			set_notify('success', lang('save_data_complete'));
		}
		redirect('district_infos/admin/district_infos/form/'.$_POST['id']);
	}
}
?>